
    class Animal implements Cloneable{
        private String name;

        private int[] intes;
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }

        @Override
        protected Object clone() throws CloneNotSupportedException {
            return super.clone();
        }

        @Override
        public String toString() {
            return "Animal{" +
                    "name='" + name + '\'' +
                    '}';
        }

        public Animal(String name) {
            this.name = name;
        }

        public static void main(String[] args) throws CloneNotSupportedException {
            Animal animal1 = new Animal("小鸟");
            Animal animal2 = (Animal) animal1.clone();
            System.out.println(animal1.equals(animal2));
            animal2.setName("小鸡");
            System.out.println(animal1);
            System.out.println(animal2);
            System.out.println(animal1);
        }
    }
